#include "ImoBlock.h"

ImoBlock::ImoBlock(int locx, int locy, int locz,vector<vector<vector<Floor*>>> floor)
{
	collision = false;
	dir = NODIR;
	theFloor = floor;
	x = locx;
	y = locy;
	z = locz;
	type = IMOBLOCK;
	
	removeable = false;
}

ImoBlock::~ImoBlock(void)
{
}



//When an this object is hit by the collider do certain stuff
void ImoBlock::collide(Object* collider)
{
	//assume that collision will be over (if its not it'll flag itself again)
	collision=false;


}

//When this object hits another object do certain stuff (ie if its an exit win the game)
void ImoBlock::collideWith(Object* collidee){
	//All collisions must end by flagging collision as false
	collision = false;

}
void ImoBlock::doFloor(Equip currentEquip){

	condition = FINE;

	if(theFloor[x][y][z] ->getType() == FIRE){
		theFloor[x][y][z] ->changeState(EXTINGUISHED);
	}
	if(theFloor[x][y][z]->getType() == WATER && theFloor[x][y][z]->getFloorState() == WATERFILLED){
		theFloor[x][y][z] ->changeState(BLOCKFILLED);
		removeable = true;
		theFloor[x][y][z] ->changeObject(NONE);
	}


}